﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data.SqlClient;
using DAL.Entities;

namespace DAL
{
    public class TipoPagoDAL : DBController
    {
        public ArrayList ObtenerMediosPago()
        {
            ArrayList medios = new ArrayList();

            using (SqlConnection conn = this.OpenConn())
            {
                SqlDataReader reader;
                SqlCommand cmd = new SqlCommand("maravilla_sql.spObtenerMediosPago", conn);

                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    TipoPago tipo = new TipoPago();

                    tipo.Id = Convert.ToInt32(reader["intidtipo_pago"]);
                    tipo.Nombre = reader["varnombre"].ToString();

                    medios.Add(tipo);
                }
            }

            return medios;
        }
    }
}
